import request from '@/utils/request'

// 查询承包商违章记录列表
export function listViolation(query) {
  return request({
    url: '/cbs/workplace/violation/list',
    method: 'get',
    params: query
  })
}

// 查询承包商违章记录详细
export function getViolation(id) {
  return request({
    url: '/cbs/workplace/violation/' + id,
    method: 'get'
  })
}

// 新增承包商违章记录
export function addViolation(data) {
  return request({
    url: '/cbs/workplace/violation',
    method: 'post',
    data: data
  })
}

// 修改承包商违章记录
export function updateViolation(data) {
  return request({
    url: '/cbs/workplace/violation',
    method: 'put',
    data: data
  })
}

// 删除承包商违章记录
export function delViolation(id) {
  return request({
    url: '/cbs/workplace/violation/' + id,
    method: 'delete'
  })
}
